//求子集(给定集合中无重复元素) 力扣78
//回溯算法 收集每一个节点作为答案
class Solution {
public:
	vector<vector<int>> ans;
	vector<int> path;
	void backtracking(vector<int> nums,int startindex)
	{
		ans.push_back(path);
		for(int i = startindex; i < nums.size(); i++)
		{
			path.push_back(nums[i]);
			backtracking(nums,i+1);
			path.pop_back();
		}
	}
	vector<vector<int>> subsets(vector<int>& nums) {
		backtracking(nums,0);
		return ans;
	}
};
